<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>入库单状态</title>
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <link rel="stylesheet" href="../../css/bootstrap-table.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="../../js/bootstrap-table.min.js"></script>
    <script src="../../js/bootstrap.min.js"></script>
    <script src="../../js/bootstrap-table-zh-CN.min.js"></script>
    <script>
        $(function () {
            $("#GatherAllTab").bootstrapTable({
                method: "get",
                contentType: "application/json;charset=utf-8",
                url: "/sgather/queryGatherAll",
                striped: true,
                pageNumber: 1,
                pagination: true,
                sidePagination: 'server',
                pageSize: 5,
                pageList: [3, 5, 6, 10],
                queryParams: function (params) {
                    return {
                        // 计算页号(当前页)
                        pageNumber: (params.offset / params.limit) + 1,
                        // 计算页大小
                        pageSize: params.limit,
                    }
                },
                columns: [
                    {title: '序号', field: 'id', align: 'center'},
                    {title: '申请单编号', field: 'gatherId', align: 'center'},
                    {title: '入库理由', field: 'reason', align: 'center', formatter: function (value, row, index) {

                            if (value == "r001-1") {
                                return "生产入库";

                            } else if (value == "r001-2") {

                                return "库存初始";

                            } else if (value == "r001-3") {
                                return "赠送";

                            } else if (value == "r001-4") {


                                return "内部归还"
                            } else {


                                return "其他归还";

                            }

                        }
                    },
                    {title: '登记时间', field: 'registerTime', align: 'center'},
                    {title: '总件数', field: 'amountSum', align: 'center'},
                    {title: '申请单状态', field: 'checkTag', align: 'center',formatter:function (value,row,index) {
                        if(value=='s001-0'){
                            return "<span class='btn btn-outline-warning'>等待</span>";
                        }else if(value=='s001-1'){
                            return "<span class='btn btn-outline-success'>通过</span>";
                        }else if(value=='s001-2'){
                            return "<span class='btn btn-outline-danger'>不通过</span>";
                        }
                        }},

                ]
            })
        });
    </script>
</head>
<body>
<table id="GatherAllTab" class="table">

</table>
</body>
</html>